home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2006 December
/
chip-cd_2006_12.zip
/
12
/
Pakiet internetowy
/
Stacje TV i radiowe (odsluchiwanie i rippowanie)
/
StationRipper 2.70c
/
StationRipperInst.exe
/
MM_AddTrack.vbs
< prev
next >
Wrap
Text File
|
2005-06-26
|
2KB
|
96 lines
sMP3Path = Wscript.Arguments(0)
bAutoPlay = Wscript.Arguments(1)
sPlaylistName = Wscript.Arguments(2)
sPlaylistName2 = Wscript.Arguments(3)
sPlaylistName3 = Wscript.Arguments(4)
'WScript.Echo("Path=" & sMP3Path)
'WScript.Echo("List1 = " & sPlaylistName)
'WScript.Echo("List2 = " & sPlaylistName2)
'WScript.Echo("List3 = " & sPlaylistName3)
'WScript.Echo("AutoPlay = " & bAutoPlay)
Dim Tree
Dim SDB 'As SongsDB.SDBApplication
Dim WSHShell
Dim sMMPath
'
' Get a interface to the running MM
'
Set SDB = CreateObject("SongsDB.SDBApplication")
If IsNull(SDB) Then
Return
End If
'
' Add the Song to the main DB. Tell MM to figure out details about
' the song.
'
Set songData = SDB.NewSongData
songData.Path = sMP3Path
songData.MetadataFromFilename
songData.ReadTags
songData.UpdateDB
'
' Start play song if needed
'
If bAutoPlay = "true" Then
SDB.Player.PlaylistClear
SDB.Player.CurrentSongIndex = 0
SDB.Player.PlaylistAddTrack (songData)
SDB.Player.Play
End If
Dim playList' As SDBPlaylist
'
' If a Playlist was passed, add the song to to the playlist
'
If Len(sPlaylistName) > 0 Then
Set Tree = SDB.MainTree
Set playList = SDB.PlaylistByTitle(sPlaylistName)
If IsNull(playList) Or Len(playList.Title) = 0 Then
Set playList = SDB.PlaylistByTitle("").CreateChildPlaylist(sPlaylistName)
End If
playList.AddTrack (songData)
End If
If Len(sPlaylistName2) > 0 Then
Set Tree = SDB.MainTree
Set playList = SDB.PlaylistByTitle(sPlaylistName2)
If IsNull(playList) Or Len(playList.Title) = 0 Then
Set playList = SDB.PlaylistByTitle("").CreateChildPlaylist(sPlaylistName2)
End If
playList.AddTrack (songData)
End If
If Len(sPlaylistName3) > 0 Then
Set Tree = SDB.MainTree
Set playList = SDB.PlaylistByTitle(sPlaylistName3)
If IsNull(playList) Or Len(playList.Title) = 0 Then
Set playList = SDB.PlaylistByTitle("").CreateChildPlaylist(sPlaylistName3)
End If
playList.AddTrack (songData)
End If